{{useCss "/app-pages/css/pay.scss"}}
<div class="_pay">
    <div class="order {{#if $Cache.pay.is_change_address}}focus{{/if}}">
        <div class="item">
            <div class="iinfo">
                {{#if $Cache.pay.pay_ach.info.user_address}}
                <L:input class="focus" bind-input="{{'$Cache.sign_in.name'}}" placeholder="联系人" disabled="disabled" bind-value="{{$Cache.pay.pay_ach.info.user_address.name+' , '+$Cache.pay.pay_ach.info.user_address.mobilenumber}}"></L:input>
                <L:input class="focus" placeholder="收货地址" disabled="disabled" bind-value="{{$Cache.pay.pay_ach.info.user_address.province+', '+$Cache.pay.pay_ach.info.user_address.town+', '+$Cache.pay.pay_ach.info.user_address.county+', '+$Cache.pay.pay_ach.info.user_address.detail}}"></L:input>
                {{#if $Cache.pay.pay_ach.info.state==config.ACH_STATE.未确认}}
                <div style="margin-top:-20px;">
                    <button class="btn" event-click="{{'$Event.pay.change_addr'}}">更改收货地址</button>
                </div>
                {{/if}}
                {{#else}}
                <button class="btn" event-click="{{'$Event.pay.change_addr'}}">选择收货信息</button>
                {{/if}}
            </div>
        </div>
        <div class="item {{$Cache.pay.whichpay}}">
            <div class="iinfo">
                <L:input placeholder="备注"></L:input>
                <div class="ititle">支付方式</div>
                {{#if $Cache.pay.pay_ach.info.state==config.ACH_STATE.未确认}}
                <mbPayMethod
                    value="alipay.wap.auth.authAndExecute"
                    text="支付宝"
                    intro="使用支付宝网页支付"
                    disabled="{{!(bus_info.info.alipay.seller_email&&bus_info.info.alipay.key&&bus_info.info.alipay.partner)}}"
                ></mbPayMethod>
                {{#if !$Cache.pay.pay_ach.info.is_only_online_pay}}
                <mbPayMethod
                    value="payment_in_cash"
                    text="货到付款"
                    intro="用于大金额订单"
                ></mbPayMethod>
                {{/if}}
                {{#if $Top._is_weixin}}
                <mbPayMethod
                    value="weixin_pay"
                    text="微信支付"
                    intro="在微信中直接使用微信进行支付"
                ></mbPayMethod>
                {{/if}}
                {{#else}}
                <br/>
                <p>
                    {{#if $Cache.pay.pay_ach.info.pay_method=="alipay.wap.auth.authAndExecute"}}
                    使用支付宝的快捷支付(不可更改)
                    {{/if}}
                    {{#if $Cache.pay.pay_ach.info.pay_method=="payment_in_cash"}}
                    货到付款(不可更改)
                    {{/if}}
                    {{#if $Cache.pay.pay_ach.info.pay_method=="weixin_pay"}}
                    微信支付(不可更改)
                    {{/if}}
                </p>
                {{/if}}
            </div>
        </div>
    </div>
    <div class="address">
        <div>
            <button class="btn" event-click="{{'$Event.pay.change_addr'}}">返回</button>
        </div>
        {{#each user.address_detail}}
        <div class="addr {{#if $Top.$Cache.pay.pay_ach.info.user_address._id==_id}}focus{{/if}}" event-click="{{'$Top.$Event.pay.change_user_address'}}">{{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}}{{town}}{{county}}，{{detail}}</div>
        {{/each}}

        <button class="btn" event-click="{{'$Event.pay.isadd_addr'}}">{{#if $Cache.pay.isadd_addr}}取消{{#else}}增加地址{{/if}}</button>
        <div class="add_info {{#if $Cache.pay.isadd_addr}}focus{{/if}}">
            <select name="province" event-change="{{'$Event.province'}}">
                <option class="first" value="0">请选择省</option>
                {{#each city_list}}
                <option rel="{{region_id}}" value="{{region_name}}">
                    {{region_name}}
                </option>
                {{/each}}
            </select>

            <select name="city" disabled event-change="{{'$Event.city'}}">
                <option class="first" value="0">请选择市</option>
            </select>

            <select name="area" disabled>
                <option class="first" value="0">请选择地区</option>
            </select>
            <L:input name="detailed_addre" placeholder="详细地址"></L:input>
            <L:input name="name" placeholder="姓名"></L:input>
            <L:input name="mobile_num" placeholder="手机号"></L:input>
            <button class="btn" event-click="{{'$Event.pay.add_user_address'}}">确认地址</button>
        </div>
    </div>
</div>


<div class="blockbottom"></div>
<div class="topay {{#if $Cache.pay.pay_ach.info.state==config.ACH_STATE.ol未付款||$Cache.pay.pay_ach.info.state==config.ACH_STATE.未发货}}focus{{/if}}">
	应付金额:<span style="color:red">￥{{#Fixed $Cache.pay.pay_ach.cash}}</span>
    {{#> "user_ach_controller","$Cache.pay.pay_ach"}}
</div>
<xmp type="tag" name="mbPayMethod">
    <button class="pay-type-wrap {{$Top.$Cache.pay.pay_ach.info.pay_method=='${value}'&&'checked'}}" event-click="{{'$Top.$Event.pay.change_pay_method'}}" ${__all_attrs__} >
        <div class="pay-type pay3" name="pay3" event-click="{{'$Event.pay.changepay'}}">
        ${text}<span>${intro}</span>
        </div>
    </button>
</xmp>